package com.cjm.one.system.client;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.common.constant.ServerConstants;
import com.cjm.one.common.result.Result;
import com.cjm.one.model.base.BaseDeleteMoreVo;
import com.cjm.one.model.system.dto.SysRoleDto;
import com.cjm.one.model.system.entity.SysRole;
import com.cjm.one.model.system.vo.RoleDetailVO;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = ServerConstants.SERVER_ONE_SYSTEM)
public interface SystemRoleClient {
    /**
     * @description: 获取全部角色list
     * @author: cjm
     * @date: 2024/10/4 10:41
     * @param: []
     * @return: com.cjm.one.common.result.Result<java.util.List<com.cjm.one.model.system.entity.SysRole>>
     **/
    @GetMapping("/admin/system/role/list")
    Result<List<SysRole>> list() ;
    /**
     * @description: 查询角色列表条件
     * @author: cjm
     * @date: 2024/10/8 14:06
     * @param: [sysRoleDto]
     * @return: com.cjm.one.common.result.Result<com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.cjm.one.model.system.entity.SysRole>>
     **/
    @PostMapping("/admin/system/role/page/list")
    Result<Page<SysRole>> page(@RequestBody SysRoleDto sysRoleDto) ;
    /**
     * @description:更新角色
     * @author: cjm
     * @date: 2024/10/8 18:03
     * @param: [sysRole]
     * @return: com.cjm.one.common.result.Result<java.lang.Boolean>
     **/
    @PutMapping("/admin/system/role")

     Result<Boolean> update(@RequestBody RoleDetailVO sysRole) ;
    /**
     * @description: 新增角色
     * @author: cjm
     * @date: 2024/10/8 18:05
     * @param: [sysRole]
     * @return: com.cjm.one.common.result.Result<java.lang.Boolean>
     **/
    @PostMapping("/admin/system/role")
    @Operation(summary = "新增角色")
    Result<Boolean> addSysRole(@RequestBody RoleDetailVO sysRole) ;
    /**
     * @description: 删除角色
     * @author: cjm 
     * @date: 2024/10/8 18:07
     * @param: [id]
     * @return: com.cjm.one.common.result.Result<java.lang.Boolean>
     **/
    @DeleteMapping("/admin/system/role/{id}")
    @Operation(summary = "删除角色")
    Result<Boolean> delete(@PathVariable("id") Long id) ;
    /**
     * @description: 根据id查询角色
     * @author: cjm 
     * @date: 2024/10/8 18:08
     * @param: [id]
     * @return: com.cjm.one.common.result.Result<com.cjm.one.model.system.entity.SysRole>
     **/
    @GetMapping("/admin/system/role/{id}")
    @Operation(summary = "根据id查询角色")
    Result<SysRole> getById(@PathVariable("id") Long id) ;
    /**
     * @description: 批量删除角色
     * @author: cjm
     * @date: 2024/10/8 20:59
     * @param: [ids]
     * @return: com.cjm.one.common.result.Result<java.lang.Boolean>
     **/
    @DeleteMapping("/admin/system/role/batch")
    @Operation(summary = "批量删除角色")
    Result<BaseDeleteMoreVo> deleteBatchIds(@RequestBody List<Long> ids) ;
    /**
     * @description: 更新角色状态
     * @author: cjm
     * @date: 2024/10/8 21:00
     * @param: [sysRole]
     * @return: com.cjm.one.common.result.Result<java.lang.Boolean>
     **/
    @PutMapping("/admin/system/role/status")
    @Operation(summary = "更新角色状态")
    Result<Boolean> updateStatus(@RequestBody SysRole sysRole) ;
    @GetMapping("/admin/system/role/{id}/detail")
    @Operation(summary = "根据id查询角色详情包含权限列表")
    Result<RoleDetailVO> getSysRoleDetail(@PathVariable("id") Long id);
}
